﻿/// ---------------------------------------------
/// 2012.6.7
/// 汪定新
///
/// ---------------------------------------------
//双击事件
function CustomDbClick() {
    if (typeof (fnCustomEdit) == "function") {
        fnCustomEdit();
    }
}
//----------------------------------------------
//添加
var fnCustomAdd = function () {
    document.getElementById("dialog1_h").innerHTML = "新增简历类别";
    document.getElementById("EditUIWindow").src = "../Extend/AutoLoadForm.aspx?r=" + Math.random() + "&entity=" + const_EditEntity;
    SetDWH(400, 200, YAHOO.example.container.dialog1);
    YAHOO.example.container.dialog1.show();
}
//编辑
var fnCustomEdit = function () {
    var recordID = myDataTable.getSelectedRows()[0];
    record = myDataTable.getRecord(recordID);
    if (record == null) {
        alert("请选择一条记录");
        return;
    }
    document.getElementById("dialog1_h").innerHTML = "修改简历类别";
    document.getElementById("EditUIWindow").src = "../Extend/AutoLoadForm.aspx?id=" + record.getData(const_entityID) + "&entity=" + const_EditEntity;
    SetDWH(400, 200, YAHOO.example.container.dialog1);
    YAHOO.example.container.dialog1.show();
}
//页面加载时
if (typeof ($) != "undefined") {
    $(document).ready(function () {
        var id = getPar1('id');
        //alert(id);
        if (id != "") {
            instance[0].ID = id;
        }
    });
}
//数据验证
var fnCheckData = function () {
    var str = $("#CategoryName").val();
    str = str.replace(/(^\s*)|(\s*$)/g, "");
    if (str == "") {
        return "简历类别名称不能为空!";
    }
}

//去除空格
String.prototype.trim = function () {
    return this.replace(/(^\s*)|(\s*$)/g, "");
}
